package org.zsl.dao;

import com.mysql.cj.protocol.Resultset;
import org.zsl.model.User;

import java.sql.ResultSet;

public class UserDAO2 implements IUserDAO{
    @Override
    public Boolean insert(User user) {
         String sql = "insert into user(username,password,role_id) value(?,?,?)";
         Object[] params = new Object[]{
                 user.getUsername(),user.getPassword(),user.getRoleId()
         };

       return  DButil.uptate(sql,params);

    }

    @Override
    public Boolean delete(Integer userId) {
        return null;
    }

    @Override
    public Boolean update(User user) {
        return null;
    }

    @Override
    public ResultSet selectAll() {
        String sql = "select * from user";
        return DButil.query(sql,null);
    }


}
